/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.hk.adv.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.hk.adv.entity.HkAllAdv;
import com.thinkgem.jeesite.modules.hk.adv.dao.HkAllAdvDao;

/**
 * 所有广告Service
 * @author 罗天文
 * @version 2018-03-19
 */
@Service
@Transactional(readOnly = true)
public class HkAllAdvService extends CrudService<HkAllAdvDao, HkAllAdv> {

	public HkAllAdv get(String id) {
		return super.get(id);
	}
	
	public List<HkAllAdv> findList(HkAllAdv hkAllAdv) {
		return super.findList(hkAllAdv);
	}
	
	public Page<HkAllAdv> findPage(Page<HkAllAdv> page, HkAllAdv hkAllAdv) {
		return super.findPage(page, hkAllAdv);
	}
	
	@Transactional(readOnly = false)
	public void save(HkAllAdv hkAllAdv) {
		super.save(hkAllAdv);
	}
	
	@Transactional(readOnly = false)
	public void delete(HkAllAdv hkAllAdv) {
		super.delete(hkAllAdv);
	}

	public void deleteTag(String id, String tag) {
		super.dao.deleteTag(id,tag);
	}

	public void insertTag(String id, String tag) {
		Map map=new HashMap();
		map.put("id",id);
		map.put("tag",tag.split(","));
		super.dao.insertTag(map);
	}

	public void deleteCategory(String id, String category) {
		super.dao.deleteCategory(id,category);
	}

	public void insertCategory(String id, String category) {
		Map map=new HashMap();
		map.put("id",id);
		map.put("category",category.split(","));
		super.dao.insertCategory(map);
	}

	public HkAllAdv getBySourceId(String sourceId) {
		return super.dao.getBySourceId(sourceId);
	}
}